home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
controls
/
edactive.frm
< prev
next >
Wrap
Text File
|
1993-05-16
|
3KB
|
110 lines
VERSION 2.00
Begin Form Form1
Caption = "Using Screen.ActiveControl"
ClientHeight = 4020
ClientLeft = 1095
ClientTop = 1770
ClientWidth = 7365
Height = 4710
Left = 1035
LinkTopic = "Form1"
ScaleHeight = 4020
ScaleWidth = 7365
Top = 1140
Width = 7485
Begin TextBox txtBuffer
Height = 2295
Left = 4680
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 1
Top = 960
Width = 2295
End
Begin TextBox txtEditBox
Height = 2295
Left = 480
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 0
Top = 960
Width = 2295
End
Begin Label Label2
Caption = "Paste Buffer"
Height = 255
Left = 4680
TabIndex = 3
Top = 720
Width = 1215
End
Begin Label Label1
Caption = "Editing Box"
Height = 255
Left = 480
TabIndex = 2
Top = 720
Width = 1215
End
Begin Menu mnuFile
Caption = "&File"
Begin Menu mnuFileExit
Caption = "E&xit"
End
End
Begin Menu mnuEdit
Caption = "&Edit"
Begin Menu mnuEditCut
Caption = "Cu&t"
Shortcut = ^X
End
Begin Menu mnuEditCopy
Caption = "&Copy"
Shortcut = ^C
End
Begin Menu mnuEditPaste
Caption = "&Paste"
Shortcut = ^V
End
End
End
Option Explicit
Dim msg1 As String
Dim msg2 As String
Sub Form_Load ()
msg1 = "The Editing box must be the active control!"
msg2 = "Do you know where the focus is?"
End Sub
Sub mnuEditCopy_Click ()
If screen.ActiveControl Is txtEditBox Then
txtBuffer.Text = txtEditBox.SelText
Else
MsgBox msg1, 0, msg2
End If
End Sub
Sub mnuEditCut_Click ()
If screen.ActiveControl Is txtEditBox Then
txtBuffer.Text = txtEditBox.SelText
txtEditBox.SelText = ""
Else
MsgBox msg1, 0, msg2
End If
End Sub
Sub mnuEditPaste_Click ()
If screen.ActiveControl Is txtEditBox Then
txtEditBox.SelText = txtBuffer.Text
Else
MsgBox msg1, 0, msg2
End If
End Sub
Sub mnuFileExit_Click ()
End
End Sub